﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>01-XTypeTest</title>
    <link href="../dist/css/bootstrap.css" rel="stylesheet" />
</head>
<body>
    <script src="../dist/js/jquery.js"></script>
    <script src="../dist/js/popper.js"></script>
    <script src="../dist/js/bootstrap.js"></script>
    <script src="../dist/js/bootstrap-es6.js"></script>
    <script>
        class Test {
            run() {
                alert('This is Test Class.');
            }
        }
        XType.add('test', Test);

        var cls = XType.get({
            xtype: 'test'
        });
        cls.run();

        XType.remove('test');
        var cls1 = XType.get({ // 这里直接抛出异常
            xtype: 'test'
        });
        alert(cls1);
    </script>
</body>
</html>